home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume4 / cubes / patch1 < prev   
Encoding:
Internet Message Format  |  1988-06-16  |  38.8 KB

  1. Path: uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!tektronix!tekgen!tekred!games
  2. From: games@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v04i041:  cubes - a netowrked dice game, Patch1
  5. Message-ID: <2650@tekred.TEK.COM>
  6. Date: 16 Jun 88 21:30:46 GMT
  7. Sender: billr@tekred.TEK.COM
  8. Lines: 1534
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted by: gmp@rayssd.RAY.COM (Gregory M. Paris)
  12. Comp.sources.games: Volume 4, Issue 41
  13. Archive-name: cubes/Patch1
  14.  
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of shell archive."
  23. # Contents:  cubes.pch1
  24. # Wrapped by billr@saab on Thu Jun 16 14:03:06 1988
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f cubes.pch1 -a "${1}" != "-c" ; then 
  27.   echo shar: Will not over-write existing file \"cubes.pch1\"
  28. else
  29. echo shar: Extracting \"cubes.pch1\" \(36850 characters\)
  30. sed "s/^X//" >cubes.pch1 <<'END_OF_cubes.pch1'
  31. XIndex: README
  32. XPrereq: cubes
  33. X*** README.orig    Thu Jun  2 22:45:16 1988
  34. X--- README    Wed Jun 15 15:26:38 1988
  35. X***************
  36. X*** 91,93
  37. X  Greg Paris, June 2, 1988
  38. X  gmp@rayssd.ray.com or gmp%rayssd.ray.com@a.cs.uiuc.edu
  39. X  {att,decuac,gatech,necntc,sun,uiucdcs,ukma}!rayssd!gmp
  40. X
  41. X--- 91,119 -----
  42. X  Greg Paris, June 2, 1988
  43. X  gmp@rayssd.ray.com or gmp%rayssd.ray.com@a.cs.uiuc.edu
  44. X  {att,decuac,gatech,necntc,sun,uiucdcs,ukma}!rayssd!gmp
  45. X+ 
  46. X+ -------------------------------------------------------------------------------
  47. X+ This is patch #1 for cubes.  It brings all source files and the manual page
  48. X+ to revision level 2.1.  Notable changes due to this patch are listed below.
  49. X+ 
  50. X+ 1. Corrects a bug with the server that caused it to go into a wait loop rather
  51. X+    than hang in select as it was supposed to do.
  52. X+ 2. Causes the screen to be updated properly when leaving quiet mode.
  53. X+ 3. Fixes an insignificant bug in the ordering of the score file.
  54. X+ 4. Late entries are added to the beginning rather than the end of the roster.
  55. X+ 5. Late entries are given 500 points less than the lowest (was 75% of lowest).
  56. X+ 6. Redraws the roster when players leave the game.
  57. X+ 7. Assigns proxies when players leave before getting on board (sometimes).
  58. X+ 8. Checks the CUBEHOST environment variable for a favorite server host.
  59. X+ 9. Corrected some spelling errors (including one misspelled computer).
  60. X+ 
  61. X+ This patch does not attempt to correct your player scoring history file,
  62. X+ nominally /usr/games/lib/cubes.hist.  The name of the computer player
  63. X+ Woper has been changed to the correct spelling W.O.P.R.  If you care, then
  64. X+ you should make this change to your score file manually.  Make the change
  65. X+ before you start up the newly installed server, but after killing any
  66. X+ running old one.
  67. X+ 
  68. X+ Greg Paris
  69. X+ June 15, 1988
  70. X+ 
  71. X
  72. XIndex: actions.c
  73. XPrereq: 1.1
  74. X*** actions.c.orig    Wed Jun 15 13:57:00 1988
  75. X--- actions.c    Wed Jun 15 13:57:01 1988
  76. X***************
  77. X*** 1,6
  78. X  /*    vi:set sw=4 ts=4: */
  79. X  #ifndef    lint
  80. X! static char    sccsid[] = "@(#)actions.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  81. X  #endif    lint
  82. X  
  83. X  #include    <stdio.h>
  84. X
  85. X--- 1,6 -----
  86. X  /*    vi:set sw=4 ts=4: */
  87. X  #ifndef    lint
  88. X! static char    sccsid[] = "@(#)actions.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  89. X  #endif    lint
  90. X  
  91. X  #include    <stdio.h>
  92. X
  93. XIndex: avg.c
  94. XPrereq: 1.1
  95. X*** avg.c.orig    Wed Jun 15 13:57:07 1988
  96. X--- avg.c    Wed Jun 15 13:57:08 1988
  97. X***************
  98. X*** 1,6
  99. X  /*    vi:set sw=4 ts=4: */
  100. X  #ifndef    lint
  101. X! static char    sccsid[] = "@(#)avg.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  102. X  #endif    lint
  103. X  
  104. X  #include    <stdio.h>
  105. X
  106. X--- 1,6 -----
  107. X  /*    vi:set sw=4 ts=4: */
  108. X  #ifndef    lint
  109. X! static char    sccsid[] = "@(#)avg.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  110. X  #endif    lint
  111. X  
  112. X  #include    <stdio.h>
  113. X
  114. XIndex: cubes.6
  115. XPrereq: CUBES
  116. X*** cubes.6.orig    Wed Jun 15 13:59:59 1988
  117. X--- cubes.6    Wed Jun 15 13:36:54 1988
  118. X***************
  119. X*** 1,5
  120. X  .TH CUBES 6-usenet comp.sources.games USENET "UNIX Gaming Manual"
  121. X! .\" Copyright 1988 Gregory M. Paris
  122. X  .SH NAME
  123. X  cubes \- multi-player dice game
  124. X  .SH SYNOPSIS
  125. X
  126. X--- 1,5 -----
  127. X  .TH CUBES 6-usenet comp.sources.games USENET "UNIX Gaming Manual"
  128. X! .\" sccsid: @(#)cubes.6 2.1 6/15/88 Copyright 1988 Gregory M. Paris
  129. X  .SH NAME
  130. X  cubes \- multi-player dice game
  131. X  .SH SYNOPSIS
  132. X***************
  133. X*** 44,50
  134. X  The program assumes that the server is on the same system as the player.
  135. X  If this is not so, the
  136. X  .RB ` \-h \  host '
  137. X! option must be used to tell
  138. X  .I cubes
  139. X  which system the server is running on.
  140. X  .PP
  141. X
  142. X--- 44,50 -----
  143. X  The program assumes that the server is on the same system as the player.
  144. X  If this is not so, the
  145. X  .RB ` \-h \  host '
  146. X! option can be used to tell
  147. X  .I cubes
  148. X  which system the server is running on.
  149. X  If you normally connect to a server on another system,
  150. X***************
  151. X*** 47,52
  152. X  option must be used to tell
  153. X  .I cubes
  154. X  which system the server is running on.
  155. X  .PP
  156. X  If your terminal supports either DEC or Zenith graphics character sets,
  157. X  you can tell
  158. X
  159. X--- 47,57 -----
  160. X  option can be used to tell
  161. X  .I cubes
  162. X  which system the server is running on.
  163. X+ If you normally connect to a server on another system,
  164. X+ you may find it more convenient to set the
  165. X+ .B CUBEHOST
  166. X+ environment variable to that system's name.
  167. X+ (The command line option overrides the environment variable.)
  168. X  .PP
  169. X  If your terminal supports either DEC or Zenith graphics character sets,
  170. X  you can tell
  171. X***************
  172. X*** 305,311
  173. X  .PP
  174. X  It should be noted that quitting a game before it ends may result in a
  175. X  low score being added to your record.
  176. X! This will not happen if you have zero points when you quit.
  177. X  Quitting at any other time could lower your ranking against other players.
  178. X  .SH MISCELLANY
  179. X  It is possible to join a game in progress.
  180. X
  181. X--- 310,318 -----
  182. X  .PP
  183. X  It should be noted that quitting a game before it ends may result in a
  184. X  low score being added to your record.
  185. X! This will not happen if you are not yet on board when you quit
  186. X! (but read the miscellaneous item below about proxy players
  187. X! for a qualification to this remark).
  188. X  Quitting at any other time could lower your ranking against other players.
  189. X  .SH MISCELLANY
  190. X  It is possible to join a game in progress.
  191. X***************
  192. X*** 314,320
  193. X  (defined as the high score being 9,000 points or better),
  194. X  you will be added as an active player at the end of the current round.
  195. X  Since coming into a game late with no points could ruin your ranking,
  196. X! the cube server will give you an initial score of about 75% of the lowest score,
  197. X  but you still must meet the 500 turn point
  198. X  .I On Board
  199. X  requirement in order to begin advancing your score.
  200. X
  201. X--- 321,328 -----
  202. X  (defined as the high score being 9,000 points or better),
  203. X  you will be added as an active player at the end of the current round.
  204. X  Since coming into a game late with no points could ruin your ranking,
  205. X! the cube server will give you an initial score
  206. X! that is 500 points less than the lowest score,
  207. X  but you still must meet the 500 turn point
  208. X  .I On Board
  209. X  requirement in order to begin advancing your score
  210. X***************
  211. X*** 317,323
  212. X  the cube server will give you an initial score of about 75% of the lowest score,
  213. X  but you still must meet the 500 turn point
  214. X  .I On Board
  215. X! requirement in order to begin advancing your score.
  216. X  .PP
  217. X  On some systems,
  218. X  it is possible to tell the state of the cube server by doing a
  219. X
  220. X--- 325,332 -----
  221. X  that is 500 points less than the lowest score,
  222. X  but you still must meet the 500 turn point
  223. X  .I On Board
  224. X! requirement in order to begin advancing your score
  225. X! (and you may quit the game with impunity before doing so).
  226. X  .PP
  227. X  On some systems,
  228. X  it is possible to tell the state of the cube server by doing a
  229. X
  230. XIndex: cubes.c
  231. XPrereq: 1.1
  232. X*** cubes.c.orig    Wed Jun 15 13:57:16 1988
  233. X--- cubes.c    Wed Jun 15 13:57:19 1988
  234. X***************
  235. X*** 1,6
  236. X  /*    vi:set sw=4 ts=4: */
  237. X  #ifndef    lint
  238. X! static char    sccsid[] = "@(#)cubes.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  239. X  #endif    lint
  240. X  
  241. X  #include    <stdio.h>
  242. X
  243. X--- 1,6 -----
  244. X  /*    vi:set sw=4 ts=4: */
  245. X  #ifndef    lint
  246. X! static char    sccsid[] = "@(#)cubes.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  247. X  #endif    lint
  248. X  
  249. X  #include    <stdio.h>
  250. X***************
  251. X*** 67,72
  252. X  
  253. X      if(pname == 0)
  254. X          getplrname();
  255. X      if(opensocktoserv() < 0)
  256. X          exit(1);
  257. X  
  258. X
  259. X--- 67,75 -----
  260. X  
  261. X      if(pname == 0)
  262. X          getplrname();
  263. X+     if(shost == 0)
  264. X+         shost = getenv("CUBEHOST");
  265. X+ 
  266. X      if(opensocktoserv() < 0)
  267. X          exit(1);
  268. X  
  269. X
  270. XIndex: cubes.h
  271. XPrereq: 1.1
  272. X*** cubes.h.orig    Wed Jun 15 13:57:22 1988
  273. X--- cubes.h    Wed Jun 15 13:57:24 1988
  274. X***************
  275. X*** 1,6
  276. X  /* vi:set sw=4 ts=4: */
  277. X  /*
  278. X! **    sccsid: @(#)cubes.h 1.1 6/2/88 Copyright 1988 Gregory M. Paris
  279. X  */
  280. X  
  281. X  /*
  282. X
  283. X--- 1,6 -----
  284. X  /* vi:set sw=4 ts=4: */
  285. X  /*
  286. X! **    sccsid: @(#)cubes.h 2.1 6/15/88 Copyright 1988 Gregory M. Paris
  287. X  */
  288. X  
  289. X  /*
  290. X
  291. XIndex: cubeserver.c
  292. XPrereq: 1.1
  293. X*** cubeserver.c.orig    Wed Jun 15 13:57:28 1988
  294. X--- cubeserver.c    Wed Jun 15 13:57:29 1988
  295. X***************
  296. X*** 1,6
  297. X  /*    vi:set sw=4 ts=4: */
  298. X  #ifndef    lint
  299. X! static char    sccsid[] = "@(#)cubeserver.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  300. X  #endif    lint
  301. X  
  302. X  #include    <stdio.h>
  303. X
  304. X--- 1,6 -----
  305. X  /*    vi:set sw=4 ts=4: */
  306. X  #ifndef    lint
  307. X! static char    sccsid[] = "@(#)cubeserver.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  308. X  #endif    lint
  309. X  
  310. X  #include    <stdio.h>
  311. X***************
  312. X*** 323,328
  313. X  oldplayer(c)
  314. X  register int    c;
  315. X  {
  316. X      /*
  317. X      **    Close the socket if one is open.
  318. X      */
  319. X
  320. X--- 323,330 -----
  321. X  oldplayer(c)
  322. X  register int    c;
  323. X  {
  324. X+     boolean        proxied;
  325. X+ 
  326. X      /*
  327. X      **    Close the socket if one is open.
  328. X      */
  329. X***************
  330. X*** 347,352
  331. X          plr[c].p_id[0] = '\0';
  332. X          annfarewell(c);
  333. X          break;
  334. X      case Active:
  335. X          /*
  336. X          **    If game in progress and this player has some points,
  337. X
  338. X--- 349,355 -----
  339. X          plr[c].p_id[0] = '\0';
  340. X          annfarewell(c);
  341. X          break;
  342. X+ 
  343. X      case Active:
  344. X          /*
  345. X          **    If game in progress and there are other humans playing and this
  346. X***************
  347. X*** 349,360
  348. X          break;
  349. X      case Active:
  350. X          /*
  351. X!         **    If game in progress and this player has some points,
  352. X!         **    then there's a chance that a computer proxy will be
  353. X!         **    assigned to take over.  The proxy keeps the original
  354. X!         **    name so that other players are not made aware.  The
  355. X!         **    id is also left unchanged so that a single player can't
  356. X!         **    flood the game with proxies.
  357. X          */
  358. X          if(inprogress == True && plr[c].p_onboard == True && dieroll(5) > 2) {
  359. X              plr[c].p_stat = Computer;
  360. X
  361. X--- 352,365 -----
  362. X  
  363. X      case Active:
  364. X          /*
  365. X!         **    If game in progress and there are other humans playing and this
  366. X!         **    player is on board, then there's a good chance that a computer
  367. X!         **    proxy will be assigned to take over.  The proxy keeps the original
  368. X!         **    name so that other players are not made aware.  The id is also
  369. X!         **    left unchanged so that a single player can't flood the game with
  370. X!         **    proxies.  We do this substitution, more rarely, when a player
  371. X!         **    is not yet on board, to penalize players that repeatedly start
  372. X!         **    and quit games looking for an initial big advantage.
  373. X          */
  374. X          proxied = False;
  375. X          if(inprogress == True && active > 1) {
  376. X***************
  377. X*** 356,365
  378. X          **    id is also left unchanged so that a single player can't
  379. X          **    flood the game with proxies.
  380. X          */
  381. X!         if(inprogress == True && plr[c].p_onboard == True && dieroll(5) > 2) {
  382. X!             plr[c].p_stat = Computer;
  383. X!             pickstrategy(c);    /* also chooses temperment */
  384. X!         } else {
  385. X              if(inprogress == True && plr[c].p_onboard == True)
  386. X                  histpoints(c);
  387. X              plr[c].p_stat = Inactive;
  388. X
  389. X--- 361,385 -----
  390. X          **    is not yet on board, to penalize players that repeatedly start
  391. X          **    and quit games looking for an initial big advantage.
  392. X          */
  393. X!         proxied = False;
  394. X!         if(inprogress == True && active > 1) {
  395. X!             if(    (plr[c].p_onboard == True && dieroll(5) > 2)    /* 3/5ths */
  396. X!             ||    (plr[c].p_onboard == False && dieroll(5) == 1)    /* 1/5th */
  397. X!             ) {
  398. X!                 plr[c].p_stat = Computer;
  399. X!                 pickstrategy(c);    /* also chooses temperament */
  400. X!                 proxied = True;
  401. X!             }
  402. X!         }
  403. X! 
  404. X!         /*
  405. X!         **    If the player wasn't replaced, then we remove.
  406. X!         */
  407. X!         if(proxied == False) {
  408. X!             /*
  409. X!             **    If a game is in progress and this player is onboard,
  410. X!             **    penalize for quitting by recording this score.
  411. X!             */
  412. X              if(inprogress == True && plr[c].p_onboard == True)
  413. X                  histpoints(c);
  414. X  
  415. X***************
  416. X*** 362,367
  417. X          } else {
  418. X              if(inprogress == True && plr[c].p_onboard == True)
  419. X                  histpoints(c);
  420. X              plr[c].p_stat = Inactive;
  421. X              plr[c].p_score = 0;
  422. X              plr[c].p_onboard = False;
  423. X
  424. X--- 382,388 -----
  425. X              */
  426. X              if(inprogress == True && plr[c].p_onboard == True)
  427. X                  histpoints(c);
  428. X+ 
  429. X              plr[c].p_stat = Inactive;
  430. X              plr[c].p_score = 0;
  431. X              plr[c].p_onboard = False;
  432. X***************
  433. X*** 369,375
  434. X              plr[c].p_id[0] = '\0';
  435. X              annfarewell(c);
  436. X          }
  437. X!         --active;
  438. X          break;
  439. X      case Waiting:
  440. X          plr[c].p_stat = Inactive;
  441. X
  442. X--- 390,403 -----
  443. X              plr[c].p_id[0] = '\0';
  444. X              annfarewell(c);
  445. X          }
  446. X! 
  447. X!         if(--active < 0) {
  448. X!             fprintf(stderr,
  449. X!                 "oldplayer: active=%d (shouldn't be negative)\n", active);
  450. X!             active = 0;
  451. X!         }
  452. X!         if(active == 0)
  453. X!             inprogress = False;    /* XXX: update computer points history? */
  454. X          break;
  455. X  
  456. X      case Waiting:
  457. X***************
  458. X*** 371,376
  459. X          }
  460. X          --active;
  461. X          break;
  462. X      case Waiting:
  463. X          plr[c].p_stat = Inactive;
  464. X          --waiting;
  465. X
  466. X--- 399,405 -----
  467. X          if(active == 0)
  468. X              inprogress = False;    /* XXX: update computer points history? */
  469. X          break;
  470. X+ 
  471. X      case Waiting:
  472. X          plr[c].p_stat = Inactive;
  473. X          if(--waiting < 0) {
  474. X***************
  475. X*** 373,379
  476. X          break;
  477. X      case Waiting:
  478. X          plr[c].p_stat = Inactive;
  479. X!         --waiting;
  480. X          break;
  481. X      }
  482. X      if(active <= 0) {
  483. X
  484. X--- 402,411 -----
  485. X  
  486. X      case Waiting:
  487. X          plr[c].p_stat = Inactive;
  488. X!         if(--waiting < 0) {
  489. X!             fprintf(stderr, "oldplayer: waiting=%d (shouldn't be negative)\n", waiting);
  490. X!             waiting = 0;
  491. X!         }
  492. X          break;
  493. X      }
  494. X  }
  495. X***************
  496. X*** 376,388
  497. X          --waiting;
  498. X          break;
  499. X      }
  500. X-     if(active <= 0) {
  501. X-         /*
  502. X-         **    XXX: update computer points history here?
  503. X-         */
  504. X-         inprogress = False;
  505. X-         active = 0;
  506. X-     }
  507. X  }
  508. X  
  509. X  /*
  510. X
  511. X--- 408,413 -----
  512. X          }
  513. X          break;
  514. X      }
  515. X  }
  516. X  
  517. X  /*
  518. X***************
  519. X*** 437,443
  520. X      FD_SET(plr[c].p_fd, &rdy);
  521. X      (void) select(plr[c].p_fd+1, NOSEL, &rdy, NOSEL, &poll);
  522. X      if((n = write(plr[c].p_fd, mesg, mesglen)) < 0) {
  523. X!         if(errno != EPIPE)
  524. X              perror("message: write");
  525. X          (void) alarm(0);
  526. X          oldplayer(c);
  527. X
  528. X--- 462,468 -----
  529. X      FD_SET(plr[c].p_fd, &rdy);
  530. X      (void) select(plr[c].p_fd+1, NOSEL, &rdy, NOSEL, &poll);
  531. X      if((n = write(plr[c].p_fd, mesg, mesglen)) < 0) {
  532. X!         if(errno != EPIPE && errno != ENOTCONN)
  533. X              perror("message: write");
  534. X          (void) alarm(0);
  535. X          oldplayer(c);
  536. X***************
  537. X*** 574,580
  538. X  /*21*/    "Mother",
  539. X  /*22*/    "Ashe",
  540. X  /*23*/    "Bishop",
  541. X! /*24*/    "Woper",
  542. X  /*25*/    "The Terminator",
  543. X  /*26*/    "Number Five",
  544. X  /*27*/    "Jenkins",
  545. X
  546. X--- 599,605 -----
  547. X  /*21*/    "Mother",
  548. X  /*22*/    "Ashe",
  549. X  /*23*/    "Bishop",
  550. X! /*24*/    "W.O.P.R.",
  551. X  /*25*/    "The Terminator",
  552. X  /*26*/    "Number Five",
  553. X  /*27*/    "Jenkins",
  554. X***************
  555. X*** 619,624
  556. X              ++active, --waiting;
  557. X          }
  558. X      }
  559. X  
  560. X      /*
  561. X      **    Count computer players.
  562. X
  563. X--- 644,653 -----
  564. X              ++active, --waiting;
  565. X          }
  566. X      }
  567. X+     if(waiting != 0) {
  568. X+         fprintf(stderr, "begingame: waiting=%d (should be zero)\n", waiting);
  569. X+         waiting = 0;
  570. X+     }
  571. X  
  572. X      /*
  573. X      **    Count computer players.
  574. X***************
  575. X*** 643,649
  576. X                      plr[c].p_onboard = False;
  577. X                      strcpy(plr[c].p_name, compname[cc]);
  578. X                      plr[c].p_id[0] = '\0';    /* non-proxies are null */
  579. X!                     pickstrategy(c);        /* also chooses temperment */
  580. X                      ++ncomp;
  581. X                  }
  582. X                  break;
  583. X
  584. X--- 672,678 -----
  585. X                      plr[c].p_onboard = False;
  586. X                      strcpy(plr[c].p_name, compname[cc]);
  587. X                      plr[c].p_id[0] = '\0';    /* non-proxies are null */
  588. X!                     pickstrategy(c);        /* also chooses temperament */
  589. X                      ++ncomp;
  590. X                  }
  591. X                  break;
  592. X***************
  593. X*** 809,815
  594. X      updstat(-1);
  595. X  
  596. X      /*
  597. X!     **    Add any waiting players until the game is 9/10ths over.
  598. X      */
  599. X      if(waiting > 0 && active > 0 && inprogress == True)
  600. X          if(highscore(-1) < (9 * WINSCORE) / 10)
  601. X
  602. X--- 838,846 -----
  603. X      updstat(-1);
  604. X  
  605. X      /*
  606. X!     **    If a game is inprogress, we may wish to adjust the roster
  607. X!     **    due to players entering and leaving.  We refuse to add
  608. X!     **    waiting players once the game is 9/10ths over.
  609. X      */
  610. X      if(active > 0 && inprogress == True) {
  611. X          if(waiting > 0 && highscore(-1) < (9 * WINSCORE) / 10)
  612. X***************
  613. X*** 811,819
  614. X      /*
  615. X      **    Add any waiting players until the game is 9/10ths over.
  616. X      */
  617. X!     if(waiting > 0 && active > 0 && inprogress == True)
  618. X!         if(highscore(-1) < (9 * WINSCORE) / 10)
  619. X!             addwaiting();
  620. X  }
  621. X  
  622. X  /*
  623. X
  624. X--- 842,853 -----
  625. X      **    due to players entering and leaving.  We refuse to add
  626. X      **    waiting players once the game is 9/10ths over.
  627. X      */
  628. X!     if(active > 0 && inprogress == True) {
  629. X!         if(waiting > 0 && highscore(-1) < (9 * WINSCORE) / 10)
  630. X!             fixroster(True);    /* add waiting players */
  631. X!         else
  632. X!             fixroster(False);    /* make waiting players wait */
  633. X!     }
  634. X  }
  635. X  
  636. X  /*
  637. X***************
  638. X*** 914,920
  639. X      plr[COMP].p_id[0] = '\0';
  640. X      plr[COMP].p_score = 0;
  641. X      plr[COMP].p_onboard = False;
  642. X!     pickstrategy(COMP);        /* also chooses temperment */
  643. X  }
  644. X  
  645. X  /*
  646. X
  647. X--- 948,954 -----
  648. X      plr[COMP].p_id[0] = '\0';
  649. X      plr[COMP].p_score = 0;
  650. X      plr[COMP].p_onboard = False;
  651. X!     pickstrategy(COMP);        /* also chooses temperament */
  652. X  }
  653. X  
  654. X  /*
  655. X***************
  656. X*** 1182,1188
  657. X  }
  658. X  
  659. X  /*
  660. X! **    lowscore: give new player a low score
  661. X  */
  662. X  lowscore(c)
  663. X  int        c;
  664. X
  665. X--- 1216,1222 -----
  666. X  }
  667. X  
  668. X  /*
  669. X! **    lowscore: report the lowest score
  670. X  */
  671. X  lowscore()
  672. X  {
  673. X***************
  674. X*** 1184,1191
  675. X  /*
  676. X  **    lowscore: give new player a low score
  677. X  */
  678. X! lowscore(c)
  679. X! int        c;
  680. X  {
  681. X      register int    cc, low;
  682. X  
  683. X
  684. X--- 1218,1224 -----
  685. X  /*
  686. X  **    lowscore: report the lowest score
  687. X  */
  688. X! lowscore()
  689. X  {
  690. X      register int    cc, low;
  691. X  
  692. X***************
  693. X*** 1191,1197
  694. X  
  695. X      low = 2 * WINSCORE;
  696. X      for(cc = 0;cc < PLAYERS;++cc) {
  697. X!         if(cc != c && plr[cc].p_score < low) {
  698. X              switch(plr[cc].p_stat) {
  699. X              case Active:
  700. X              case Computer:
  701. X
  702. X--- 1224,1230 -----
  703. X  
  704. X      low = 2 * WINSCORE;
  705. X      for(cc = 0;cc < PLAYERS;++cc) {
  706. X!         if(plr[cc].p_score < low) {
  707. X              switch(plr[cc].p_stat) {
  708. X              case Active:
  709. X              case Computer:
  710. X***************
  711. X*** 1201,1216
  712. X          }
  713. X      }
  714. X  
  715. X!     /*
  716. X!     **    Set player score to 75% of lowest score.  Score must be a multiple of
  717. X!     **    P_FIVE and must be greater than or equal to ONBOARD.
  718. X!     */
  719. X!     low = (3 * low) / 4;
  720. X!     low = (low / P_FIVE) * P_FIVE;
  721. X!     if(low < ONBOARD)
  722. X!         low = 0;
  723. X!     plr[c].p_score = low;        /* a putrid score, but... */
  724. X!     plr[c].p_onboard = False;    /* not on board yet */
  725. X  }
  726. X  
  727. X  /*
  728. X
  729. X--- 1234,1240 -----
  730. X          }
  731. X      }
  732. X  
  733. X!     return low;
  734. X  }
  735. X  
  736. X  /*
  737. X***************
  738. X*** 1222,1228
  739. X      register int    c, n, h;
  740. X      char            buf[2*STATLEN+NAMELEN];
  741. X  
  742. X!     if(active == 0)
  743. X          strcpy(buf, "idle");
  744. X      else {
  745. X          for(h = n = c = 0;c < PLAYERS;++c) {
  746. X
  747. X--- 1246,1252 -----
  748. X      register int    c, n, h;
  749. X      char            buf[2*STATLEN+NAMELEN];
  750. X  
  751. X!     if(active == 0 && waiting == 0)
  752. X          strcpy(buf, "idle");
  753. X      else if(active == 0 && waiting != 0)
  754. X          sprintf(buf, "idle wt%d", waiting);
  755. X***************
  756. X*** 1224,1229
  757. X  
  758. X      if(active == 0)
  759. X          strcpy(buf, "idle");
  760. X      else {
  761. X          for(h = n = c = 0;c < PLAYERS;++c) {
  762. X              if(plr[c].p_stat == Computer || plr[c].p_stat == Active) {
  763. X
  764. X--- 1248,1255 -----
  765. X  
  766. X      if(active == 0 && waiting == 0)
  767. X          strcpy(buf, "idle");
  768. X+     else if(active == 0 && waiting != 0)
  769. X+         sprintf(buf, "idle wt%d", waiting);
  770. X      else {
  771. X          for(h = n = c = 0;c < PLAYERS;++c) {
  772. X              if(plr[c].p_stat == Computer || plr[c].p_stat == Active) {
  773. X***************
  774. X*** 1236,1242
  775. X              sprintf(buf, "waiting pl%d", n);
  776. X          else if(cup < 0)
  777. X              sprintf(buf, "active pl%d hs%d tn%d", n, h, turnnum);
  778. X!         else
  779. X              sprintf(buf, "active pl%d hs%d tn%d %s",
  780. X                  n, h, turnnum, plr[cup].p_name);
  781. X      }
  782. X
  783. X--- 1262,1268 -----
  784. X              sprintf(buf, "waiting pl%d", n);
  785. X          else if(cup < 0)
  786. X              sprintf(buf, "active pl%d hs%d tn%d", n, h, turnnum);
  787. X!         else if(waiting == 0)
  788. X              sprintf(buf, "active pl%d hs%d tn%d %s",
  789. X                  n, h, turnnum, plr[cup].p_name);
  790. X          else
  791. X***************
  792. X*** 1239,1244
  793. X          else
  794. X              sprintf(buf, "active pl%d hs%d tn%d %s",
  795. X                  n, h, turnnum, plr[cup].p_name);
  796. X      }
  797. X  
  798. X      sprintf(statusline, "cubes %-*s.", STATLEN-7, buf);
  799. X
  800. X--- 1265,1273 -----
  801. X          else if(waiting == 0)
  802. X              sprintf(buf, "active pl%d hs%d tn%d %s",
  803. X                  n, h, turnnum, plr[cup].p_name);
  804. X+         else
  805. X+             sprintf(buf, "active pl%d wt%d hs%d tn%d %s",
  806. X+                 n, waiting, h, turnnum, plr[cup].p_name);
  807. X      }
  808. X  
  809. X      sprintf(statusline, "cubes %-*s.", STATLEN-7, buf);
  810. X***************
  811. X*** 1381,1387
  812. X  }
  813. X  
  814. X  /*
  815. X! **    addwaiting: add waiting players to a game in progress.
  816. X  */
  817. X  addwaiting()
  818. X  {
  819. X
  820. X--- 1410,1419 -----
  821. X  }
  822. X  
  823. X  /*
  824. X! **    fixroster: do any necessary roster adjustment
  825. X! **        if add is true, we can add waiting players to the front of
  826. X! **        the roster.  If false, we will move them to the end.
  827. X! **        Collapses out inactive slots.
  828. X  */
  829. X  fixroster(add)
  830. X  boolean        add;
  831. X***************
  832. X*** 1383,1389
  833. X  /*
  834. X  **    addwaiting: add waiting players to a game in progress.
  835. X  */
  836. X! addwaiting()
  837. X  {
  838. X      int        c, cc;
  839. X      char    msgbuf[MESGLEN];
  840. X
  841. X--- 1415,1422 -----
  842. X  **        the roster.  If false, we will move them to the end.
  843. X  **        Collapses out inactive slots.
  844. X  */
  845. X! fixroster(add)
  846. X! boolean        add;
  847. X  {
  848. X      int        c, cc, low;
  849. X      player    tmp[PLAYERS];
  850. X***************
  851. X*** 1385,1392
  852. X  */
  853. X  addwaiting()
  854. X  {
  855. X!     int        c, cc;
  856. X!     char    msgbuf[MESGLEN];
  857. X  
  858. X      if(waiting <= 0 || inprogress == False)
  859. X          return;
  860. X
  861. X--- 1418,1425 -----
  862. X  fixroster(add)
  863. X  boolean        add;
  864. X  {
  865. X!     int        c, cc, low;
  866. X!     player    tmp[PLAYERS];
  867. X  
  868. X      /*
  869. X      **    No reason to do this except during a game.
  870. X***************
  871. X*** 1388,1394
  872. X      int        c, cc;
  873. X      char    msgbuf[MESGLEN];
  874. X  
  875. X!     if(waiting <= 0 || inprogress == False)
  876. X          return;
  877. X  
  878. X      for(c = 0;c < PLAYERS;++c) {
  879. X
  880. X--- 1421,1430 -----
  881. X      int        c, cc, low;
  882. X      player    tmp[PLAYERS];
  883. X  
  884. X!     /*
  885. X!     **    No reason to do this except during a game.
  886. X!     */
  887. X!     if(inprogress == False)
  888. X          return;
  889. X  
  890. X      /*
  891. X***************
  892. X*** 1391,1401
  893. X      if(waiting <= 0 || inprogress == False)
  894. X          return;
  895. X  
  896. X!     for(c = 0;c < PLAYERS;++c) {
  897. X!         if(plr[c].p_stat != Waiting)
  898. X!             continue;
  899. X!         plr[c].p_stat = Active;
  900. X!         ++active, --waiting;
  901. X  
  902. X          sprintf(msgbuf, "%d You are player %d (%s).\r\n",
  903. X              M_UARE, c, plr[c].p_name);
  904. X
  905. X--- 1427,1448 -----
  906. X      if(inprogress == False)
  907. X          return;
  908. X  
  909. X!     /*
  910. X!     **    If there are no waiting players, or we're not allowed to add them,
  911. X!     **    check for "empty" slots in the roster.  We define empty here as
  912. X!     **    Inactive or Waiting, since to active players, slots held by
  913. X!     **    Waiting players appear empty.
  914. X!     */
  915. X!     if(waiting == 0 || add == False) {
  916. X!         for(c = 0;c < PLAYERS;++c)        /* find first empty slot */
  917. X!             if(plr[c].p_stat == Inactive || plr[c].p_stat == Waiting)
  918. X!                 break;
  919. X!         for(++c;c < PLAYERS;++c)        /* look for a non-empty slot */
  920. X!             if(plr[c].p_stat != Inactive && plr[c].p_stat != Waiting)
  921. X!                 break;
  922. X!         if(c >= PLAYERS)                /* didn't find any */
  923. X!             return;
  924. X!     }
  925. X  
  926. X      /*
  927. X      **    If we are allowed to add waiting players, put them
  928. X***************
  929. X*** 1397,1409
  930. X          plr[c].p_stat = Active;
  931. X          ++active, --waiting;
  932. X  
  933. X!         sprintf(msgbuf, "%d You are player %d (%s).\r\n",
  934. X!             M_UARE, c, plr[c].p_name);
  935. X!         if(message(c, msgbuf) < 0)
  936. X!             continue;
  937. X!         sprintf(msgbuf, "%d You have entered a game in progress.\r\n", M_INFO);
  938. X!         if(message(c, msgbuf) < 0)
  939. X!             continue;
  940. X  
  941. X          lowscore(c);
  942. X          for(cc = 0;cc < PLAYERS;++cc) {
  943. X
  944. X--- 1444,1473 -----
  945. X              return;
  946. X      }
  947. X  
  948. X!     /*
  949. X!     **    If we are allowed to add waiting players, put them
  950. X!     **    first, otherwise, put them last.  In either case,
  951. X!     **    this algorithm removes empty slots.
  952. X!     */
  953. X!     cc = 0;
  954. X!     if(add == True) {
  955. X!         for(c = 0;c < PLAYERS;++c)    /* first pass, waiting players */
  956. X!             if(plr[c].p_stat == Waiting)
  957. X!                 tmp[cc++] = plr[c];
  958. X!     }
  959. X!     for(c = 0;c < PLAYERS;++c)        /* second pass, active players */
  960. X!         if(plr[c].p_stat == Active || plr[c].p_stat == Computer)
  961. X!             tmp[cc++] = plr[c];
  962. X!     if(add == False) {
  963. X!         for(c = 0;c < PLAYERS;++c)    /* third pass, waiting players */
  964. X!             if(plr[c].p_stat == Waiting)
  965. X!                 tmp[cc++] = plr[c];
  966. X!     }
  967. X!     if(cc == 0) {
  968. X!         fprintf(stderr, "fixroster: no players!\n");
  969. X!         active = waiting = 0;
  970. X!         return;
  971. X!     }
  972. X  
  973. X      /*
  974. X      **    Calculate a suitable low score for any new players.
  975. X***************
  976. X*** 1405,1431
  977. X          if(message(c, msgbuf) < 0)
  978. X              continue;
  979. X  
  980. X!         lowscore(c);
  981. X!         for(cc = 0;cc < PLAYERS;++cc) {
  982. X!             switch(plr[cc].p_stat) {
  983. X!             case Computer:
  984. X!             case Active:
  985. X!             case Waiting:
  986. X!                 sprintf(msgbuf, "%d player %d %s\r\n",
  987. X!                     M_PNUM, cc, plr[cc].p_name);
  988. X!                 if(message(c, msgbuf) < 0) {
  989. X!                     cc = PLAYERS;
  990. X!                     continue;
  991. X!                 }
  992. X!                 sprintf(msgbuf, "%d Player %d now has %d points.\r\n",
  993. X!                     M_OSCO, cc, plr[cc].p_score);
  994. X!                 if(message(c, msgbuf) < 0) {
  995. X!                     cc = PLAYERS;
  996. X!                     continue;
  997. X!                 }
  998. X!                 break;
  999. X!             }
  1000. X!         }
  1001. X  
  1002. X          sprintf(msgbuf, "%d player %d %s\r\n", M_PNUM, c, plr[c].p_name);
  1003. X          announce(c, msgbuf);
  1004. X
  1005. X--- 1469,1479 -----
  1006. X          return;
  1007. X      }
  1008. X  
  1009. X!     /*
  1010. X!     **    Calculate a suitable low score for any new players.
  1011. X!     */
  1012. X!     if(waiting == 0 || add == False || (low = lowscore() - ONBOARD) < 0)
  1013. X!         low = 0;
  1014. X  
  1015. X      /*
  1016. X      **    Copy the reordered roster into the real one while at the
  1017. X***************
  1018. X*** 1427,1434
  1019. X              }
  1020. X          }
  1021. X  
  1022. X!         sprintf(msgbuf, "%d player %d %s\r\n", M_PNUM, c, plr[c].p_name);
  1023. X!         announce(c, msgbuf);
  1024. X!         annscore(c);
  1025. X      }
  1026. X  }
  1027. X
  1028. X--- 1475,1492 -----
  1029. X      if(waiting == 0 || add == False || (low = lowscore() - ONBOARD) < 0)
  1030. X          low = 0;
  1031. X  
  1032. X!     /*
  1033. X!     **    Copy the reordered roster into the real one while at the
  1034. X!     **    same time adding waiting players (if allowed).
  1035. X!     */
  1036. X!     for(c = 0;c < cc;++c) {
  1037. X!         plr[c] = tmp[c];
  1038. X!         if(add == True && plr[c].p_stat == Waiting) {
  1039. X!             plr[c].p_score = low;
  1040. X!             plr[c].p_onboard = False;
  1041. X!             plr[c].p_stat = Active;
  1042. X!             --waiting, ++active;
  1043. X!         }
  1044. X      }
  1045. X      for(;c < PLAYERS;++c)
  1046. X          plr[c].p_stat = Inactive;
  1047. X***************
  1048. X*** 1431,1434
  1049. X          announce(c, msgbuf);
  1050. X          annscore(c);
  1051. X      }
  1052. X  }
  1053. X
  1054. X--- 1488,1502 -----
  1055. X              --waiting, ++active;
  1056. X          }
  1057. X      }
  1058. X+     for(;c < PLAYERS;++c)
  1059. X+         plr[c].p_stat = Inactive;
  1060. X+     if(waiting != 0) {
  1061. X+         fprintf(stderr, "fixroster: waiting=%d (should be zero)\n", waiting);
  1062. X+         waiting = 0;
  1063. X+     }
  1064. X+ 
  1065. X+     /*
  1066. X+     **    Broadcast the new roster to all players.
  1067. X+     */
  1068. X+     roster(-1);
  1069. X  }
  1070. X
  1071. XIndex: dieopts.c
  1072. XPrereq: 1.1
  1073. X*** dieopts.c.orig    Wed Jun 15 13:57:34 1988
  1074. X--- dieopts.c    Wed Jun 15 13:57:35 1988
  1075. X***************
  1076. X*** 1,6
  1077. X  /*    vi:set sw=4 ts=4: */
  1078. X  #ifndef    lint
  1079. X! static char    sccsid[] = "@(#)dieopts.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1080. X  #endif    lint
  1081. X  
  1082. X  #include    <strings.h>
  1083. X
  1084. X--- 1,6 -----
  1085. X  /*    vi:set sw=4 ts=4: */
  1086. X  #ifndef    lint
  1087. X! static char    sccsid[] = "@(#)dieopts.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1088. X  #endif    lint
  1089. X  
  1090. X  #include    <strings.h>
  1091. X
  1092. XIndex: history.c
  1093. XPrereq: 1.1
  1094. X*** history.c.orig    Wed Jun 15 13:57:38 1988
  1095. X--- history.c    Wed Jun 15 13:57:39 1988
  1096. X***************
  1097. X*** 1,6
  1098. X  /*    vi:set sw=4 ts=4: */
  1099. X  #ifndef    lint
  1100. X! static char    sccsid[] = "@(#)history.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1101. X  #endif    lint
  1102. X  
  1103. X  #include    <stdio.h>
  1104. X
  1105. X--- 1,6 -----
  1106. X  /*    vi:set sw=4 ts=4: */
  1107. X  #ifndef    lint
  1108. X! static char    sccsid[] = "@(#)history.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1109. X  #endif    lint
  1110. X  
  1111. X  #include    <stdio.h>
  1112. X***************
  1113. X*** 79,86
  1114. X  }
  1115. X  
  1116. X  /*
  1117. X! **    histcmp: history comparison function
  1118. X! **        best win average, then best point average
  1119. X  */
  1120. X  histcmp(h1, h2)
  1121. X  history       *h1, *h2;
  1122. X
  1123. X--- 79,87 -----
  1124. X  }
  1125. X  
  1126. X  /*
  1127. X! **    histcmp: history comparison function for history file ordering
  1128. X! **        best win average, best point average, best avgturn, then alphabetic
  1129. X! **    NOTE: this is not the same order as ranking order
  1130. X  */
  1131. X  histcmp(h1, h2)
  1132. X  history       *h1, *h2;
  1133. X***************
  1134. X*** 87,94
  1135. X  {
  1136. X      double    v1, v2, diff;
  1137. X  
  1138. X!     v1 = h1->h_games == 0 ? 0 : (h1->h_wins / h1->h_games);
  1139. X!     v2 = h2->h_games == 0 ? 0 : (h2->h_wins / h2->h_games);
  1140. X      if((diff = v2 - v1) != 0)        /* reversed */
  1141. X          return diff < 0 ? -1 : 1;
  1142. X      v1 = h1->h_games == 0 ? 0 : (h1->h_points / h1->h_games);
  1143. X
  1144. X--- 88,95 -----
  1145. X  {
  1146. X      double    v1, v2, diff;
  1147. X  
  1148. X!     v1 = h1->h_games == 0 ? 0 : (h1->h_wins / (double)h1->h_games);
  1149. X!     v2 = h2->h_games == 0 ? 0 : (h2->h_wins / (double)h2->h_games);
  1150. X      if((diff = v2 - v1) != 0)        /* reversed */
  1151. X          return diff < 0 ? -1 : 1;
  1152. X      v1 = h1->h_games == 0 ? 0 : (h1->h_points / (double)h1->h_games);
  1153. X***************
  1154. X*** 91,98
  1155. X      v2 = h2->h_games == 0 ? 0 : (h2->h_wins / h2->h_games);
  1156. X      if((diff = v2 - v1) != 0)        /* reversed */
  1157. X          return diff < 0 ? -1 : 1;
  1158. X!     v1 = h1->h_games == 0 ? 0 : (h1->h_points / h1->h_games);
  1159. X!     v2 = h2->h_games == 0 ? 0 : (h2->h_points / h2->h_games);
  1160. X      if((diff = v2 - v1) != 0)        /* reversed */
  1161. X          return diff < 0 ? -1 : 1;
  1162. X      v1 = h1->h_games == 0 ? 0 : (h1->h_avgturn / h1->h_games);
  1163. X
  1164. X--- 92,99 -----
  1165. X      v2 = h2->h_games == 0 ? 0 : (h2->h_wins / (double)h2->h_games);
  1166. X      if((diff = v2 - v1) != 0)        /* reversed */
  1167. X          return diff < 0 ? -1 : 1;
  1168. X!     v1 = h1->h_games == 0 ? 0 : (h1->h_points / (double)h1->h_games);
  1169. X!     v2 = h2->h_games == 0 ? 0 : (h2->h_points / (double)h2->h_games);
  1170. X      if((diff = v2 - v1) != 0)        /* reversed */
  1171. X          return diff < 0 ? -1 : 1;
  1172. X      v1 = h1->h_games == 0 ? 0 : (h1->h_avgturn / (double)h1->h_games);
  1173. X***************
  1174. X*** 95,102
  1175. X      v2 = h2->h_games == 0 ? 0 : (h2->h_points / h2->h_games);
  1176. X      if((diff = v2 - v1) != 0)        /* reversed */
  1177. X          return diff < 0 ? -1 : 1;
  1178. X!     v1 = h1->h_games == 0 ? 0 : (h1->h_avgturn / h1->h_games);
  1179. X!     v2 = h2->h_games == 0 ? 0 : (h2->h_avgturn / h2->h_games);
  1180. X      if((diff = v2 - v1) != 0)        /* reversed */
  1181. X          return diff < 0 ? -1 : 1;
  1182. X      return strncmp(h1->h_id, h2->h_id, IDLEN);
  1183. X
  1184. X--- 96,103 -----
  1185. X      v2 = h2->h_games == 0 ? 0 : (h2->h_points / (double)h2->h_games);
  1186. X      if((diff = v2 - v1) != 0)        /* reversed */
  1187. X          return diff < 0 ? -1 : 1;
  1188. X!     v1 = h1->h_games == 0 ? 0 : (h1->h_avgturn / (double)h1->h_games);
  1189. X!     v2 = h2->h_games == 0 ? 0 : (h2->h_avgturn / (double)h2->h_games);
  1190. X      if((diff = v2 - v1) != 0)        /* reversed */
  1191. X          return diff < 0 ? -1 : 1;
  1192. X      return strncmp(h1->h_id, h2->h_id, IDLEN);
  1193. X
  1194. XIndex: random.c
  1195. XPrereq: 1.1
  1196. X*** random.c.orig    Wed Jun 15 13:57:44 1988
  1197. X--- random.c    Wed Jun 15 13:57:45 1988
  1198. X***************
  1199. X*** 1,6
  1200. X  /*    vi:set sw=4 ts=4: */
  1201. X  #ifndef    lint
  1202. X! static char    sccsid[] = "@(#)random.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1203. X  #endif    lint
  1204. X  
  1205. X  #include    <sys/types.h>
  1206. X
  1207. X--- 1,6 -----
  1208. X  /*    vi:set sw=4 ts=4: */
  1209. X  #ifndef    lint
  1210. X! static char    sccsid[] = "@(#)random.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1211. X  #endif    lint
  1212. X  
  1213. X  #include    <sys/types.h>
  1214. X
  1215. XIndex: risk.c
  1216. XPrereq: 1.1
  1217. X*** risk.c.orig    Wed Jun 15 13:57:50 1988
  1218. X--- risk.c    Wed Jun 15 13:57:52 1988
  1219. X***************
  1220. X*** 1,6
  1221. X  /*    vi:set sw=4 ts=4: */
  1222. X  #ifndef    lint
  1223. X! static char    sccsid[] = "@(#)risk.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1224. X  #endif    lint
  1225. X  
  1226. X  #include    "cubes.h"
  1227. X
  1228. X--- 1,6 -----
  1229. X  /*    vi:set sw=4 ts=4: */
  1230. X  #ifndef    lint
  1231. X! static char    sccsid[] = "@(#)risk.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1232. X  #endif    lint
  1233. X  
  1234. X  #include    "cubes.h"
  1235. X***************
  1236. X*** 103,109
  1237. X      xpct = expect(&temp);
  1238. X  
  1239. X      /*
  1240. X!     **    Player's temperment will chose which diceset to use.
  1241. X      **    If p_temper returns True, it means roll again.
  1242. X      */
  1243. X      if((*plr[comp].p_temper)(comp, stay, xpct, &modi) == True)
  1244. X
  1245. X--- 103,109 -----
  1246. X      xpct = expect(&temp);
  1247. X  
  1248. X      /*
  1249. X!     **    Player's temperament will chose which diceset to use.
  1250. X      **    If p_temper returns True, it means roll again.
  1251. X      */
  1252. X      if((*plr[comp].p_temper)(comp, stay, xpct, &modi) == True)
  1253. X***************
  1254. X*** 266,274
  1255. X      hesitate();
  1256. X  
  1257. X      /*
  1258. X!     **    If this computer has no score, and is not the COMP computer,
  1259. X!     **    then if the leader is more than a quarter of the way to winning,
  1260. X!     **    there's a 25% chance that this computer will quit the game.
  1261. X      */
  1262. X      if(plr[comp].p_score == 0 && strcmp(plr[comp].p_name, compname[0]) != 0) {
  1263. X          if(dieroll(12) > 8 && highscore(comp) > WINSCORE / 4) {
  1264. X
  1265. X--- 266,274 -----
  1266. X      hesitate();
  1267. X  
  1268. X      /*
  1269. X!     **    If this non-proxy computer is not on board, and is not the COMP
  1270. X!     **    computer, then 25% of the time, check to see if the leader is
  1271. X!     **    more than WINSCORE/4 points ahead.  If so, quit.
  1272. X      */
  1273. X      if(plr[comp].p_id == '\0' && plr[comp].p_onboard == False) {
  1274. X          if(strcmp(plr[comp].p_name, compname[0]) != 0 && dieroll(12) > 8) {
  1275. X***************
  1276. X*** 270,279
  1277. X      **    then if the leader is more than a quarter of the way to winning,
  1278. X      **    there's a 25% chance that this computer will quit the game.
  1279. X      */
  1280. X!     if(plr[comp].p_score == 0 && strcmp(plr[comp].p_name, compname[0]) != 0) {
  1281. X!         if(dieroll(12) > 8 && highscore(comp) > WINSCORE / 4) {
  1282. X!             oldplayer(comp);
  1283. X!             return -1;
  1284. X          }
  1285. X      }
  1286. X  
  1287. X
  1288. X--- 270,281 -----
  1289. X      **    computer, then 25% of the time, check to see if the leader is
  1290. X      **    more than WINSCORE/4 points ahead.  If so, quit.
  1291. X      */
  1292. X!     if(plr[comp].p_id == '\0' && plr[comp].p_onboard == False) {
  1293. X!         if(strcmp(plr[comp].p_name, compname[0]) != 0 && dieroll(12) > 8) {
  1294. X!             if(highscore(comp) - plr[comp].p_score > WINSCORE / 4) {
  1295. X!                 oldplayer(comp);
  1296. X!                 return -1;
  1297. X!             }
  1298. X          }
  1299. X      }
  1300. X  
  1301. X
  1302. XIndex: screen.c
  1303. XPrereq: 1.1
  1304. X*** screen.c.orig    Wed Jun 15 13:57:58 1988
  1305. X--- screen.c    Wed Jun 15 13:57:58 1988
  1306. X***************
  1307. X*** 1,6
  1308. X  /*    vi:set sw=4 ts=4: */
  1309. X  #ifndef    lint
  1310. X! static char    sccsid[] = "@(#)screen.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1311. X  #endif    lint
  1312. X  
  1313. X  #include    <stdio.h>
  1314. X
  1315. X--- 1,6 -----
  1316. X  /*    vi:set sw=4 ts=4: */
  1317. X  #ifndef    lint
  1318. X! static char    sccsid[] = "@(#)screen.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1319. X  #endif    lint
  1320. X  
  1321. X  #include    <stdio.h>
  1322. X***************
  1323. X*** 716,720
  1324. X      (void) ioctl(_tty_ch, TIOCSETN, &_tty);
  1325. X      tputs(TI, 0, outc);
  1326. X      tputs(VS, 0, outc);
  1327. X      (void) WREFRESH(curscr);
  1328. X  }
  1329. X
  1330. X--- 716,721 -----
  1331. X      (void) ioctl(_tty_ch, TIOCSETN, &_tty);
  1332. X      tputs(TI, 0, outc);
  1333. X      tputs(VS, 0, outc);
  1334. X+     touchwin(curscr);
  1335. X      (void) WREFRESH(curscr);
  1336. X  }
  1337. X
  1338. XIndex: strategies.c
  1339. XPrereq: 1.1
  1340. X*** strategies.c.orig    Wed Jun 15 13:58:03 1988
  1341. X--- strategies.c    Wed Jun 15 13:58:04 1988
  1342. X***************
  1343. X*** 1,6
  1344. X  /*    vi:set sw=4 ts=4: */
  1345. X  #ifndef    lint
  1346. X! static char    sccsid[] = "@(#)strategies.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1347. X  #endif    lint
  1348. X  
  1349. X  #include    "cubes.h"
  1350. X
  1351. X--- 1,6 -----
  1352. X  /*    vi:set sw=4 ts=4: */
  1353. X  #ifndef    lint
  1354. X! static char    sccsid[] = "@(#)strategies.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1355. X  #endif    lint
  1356. X  
  1357. X  #include    "cubes.h"
  1358. X***************
  1359. X*** 174,180
  1360. X  /*
  1361. X  **    pickstrategy: personalize each computer player
  1362. X  **        proxy players get the fickle strategy
  1363. X! **        calls picktemper to choose player temperment
  1364. X  */
  1365. X  pickstrategy(c)
  1366. X  int        c;
  1367. X
  1368. X--- 174,180 -----
  1369. X  /*
  1370. X  **    pickstrategy: personalize each computer player
  1371. X  **        proxy players get the fickle strategy
  1372. X! **        calls picktemper to choose player temperament
  1373. X  */
  1374. X  pickstrategy(c)
  1375. X  int        c;
  1376. X***************
  1377. X*** 183,189
  1378. X      register char  *name;
  1379. X  
  1380. X      /*
  1381. X!     **    First, elect the player temperment.
  1382. X      */
  1383. X      picktemper(c);
  1384. X  
  1385. X
  1386. X--- 183,189 -----
  1387. X      register char  *name;
  1388. X  
  1389. X      /*
  1390. X!     **    First, elect the player temperament.
  1391. X      */
  1392. X      picktemper(c);
  1393. X  
  1394. X
  1395. XIndex: tactics.c
  1396. XPrereq: 1.1
  1397. X*** tactics.c.orig    Wed Jun 15 13:58:08 1988
  1398. X--- tactics.c    Wed Jun 15 13:58:10 1988
  1399. X***************
  1400. X*** 1,6
  1401. X  /*    vi:set sw=4 ts=4: */
  1402. X  #ifndef    lint
  1403. X! static char    sccsid[] = "@(#)tactics.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1404. X  #endif    lint
  1405. X  
  1406. X  #include    "cubes.h"
  1407. X
  1408. X--- 1,6 -----
  1409. X  /*    vi:set sw=4 ts=4: */
  1410. X  #ifndef    lint
  1411. X! static char    sccsid[] = "@(#)tactics.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1412. X  #endif    lint
  1413. X  
  1414. X  #include    "cubes.h"
  1415. X
  1416. XIndex: tempers.c
  1417. XPrereq: 1.1
  1418. X*** tempers.c.orig    Wed Jun 15 13:58:14 1988
  1419. X--- tempers.c    Wed Jun 15 13:58:15 1988
  1420. X***************
  1421. X*** 1,6
  1422. X  /*    vi:set sw=4 ts=4: */
  1423. X  #ifndef    lint
  1424. X! static char    sccsid[] = "@(#)tempers.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1425. X  #endif    lint
  1426. X  
  1427. X  #include    "cubes.h"
  1428. X
  1429. X--- 1,6 -----
  1430. X  /*    vi:set sw=4 ts=4: */
  1431. X  #ifndef    lint
  1432. X! static char    sccsid[] = "@(#)tempers.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1433. X  #endif    lint
  1434. X  
  1435. X  #include    "cubes.h"
  1436. X***************
  1437. X*** 238,244
  1438. X  int        tempers    = sizeof temper / sizeof temper[0];
  1439. X  
  1440. X  /*
  1441. X! **    schizo: pick another temperment randomly!
  1442. X  **        for proxy players only
  1443. X  */
  1444. X  static boolean
  1445. X
  1446. X--- 238,244 -----
  1447. X  int        tempers    = sizeof temper / sizeof temper[0];
  1448. X  
  1449. X  /*
  1450. X! **    schizo: pick another temperament randomly!
  1451. X  **        for proxy players only
  1452. X  */
  1453. X  static boolean
  1454. X***************
  1455. X*** 256,262
  1456. X  
  1457. X  /*
  1458. X  **    picktemper: personalize each computer player
  1459. X! **        proxy players get the schizo temperment
  1460. X  */
  1461. X  picktemper(c)
  1462. X  int        c;
  1463. X
  1464. X--- 256,262 -----
  1465. X  
  1466. X  /*
  1467. X  **    picktemper: personalize each computer player
  1468. X! **        proxy players get the schizo temperament
  1469. X  */
  1470. X  picktemper(c)
  1471. X  int        c;
  1472. X***************
  1473. X*** 265,271
  1474. X      register char  *name;
  1475. X  
  1476. X      /*
  1477. X!     **    Proxies get a schizo temperment in order to emulate humans.
  1478. X      */
  1479. X      if(plr[c].p_id[0] != '\0') {
  1480. X          plr[c].p_temper = schizo;
  1481. X
  1482. X--- 265,271 -----
  1483. X      register char  *name;
  1484. X  
  1485. X      /*
  1486. X!     **    Proxies get a schizo temperament in order to emulate humans.
  1487. X      */
  1488. X      if(plr[c].p_id[0] != '\0') {
  1489. X          plr[c].p_temper = schizo;
  1490. X***************
  1491. X*** 273,279
  1492. X      }
  1493. X  
  1494. X      /*
  1495. X!     **    Match a name to a temperment.
  1496. X      */
  1497. X      name = plr[c].p_name;
  1498. X      for(n = 0;n < compnames;++n) {
  1499. X
  1500. X--- 273,279 -----
  1501. X      }
  1502. X  
  1503. X      /*
  1504. X!     **    Match a name to a temperament.
  1505. X      */
  1506. X      name = plr[c].p_name;
  1507. X      for(n = 0;n < compnames;++n) {
  1508. X
  1509. XIndex: turn.c
  1510. XPrereq: 1.1
  1511. X*** turn.c.orig    Wed Jun 15 13:58:17 1988
  1512. X--- turn.c    Wed Jun 15 13:58:18 1988
  1513. X***************
  1514. X*** 1,6
  1515. X  /*    vi:set sw=4 ts=4: */
  1516. X  #ifndef    lint
  1517. X! static char    sccsid[] = "@(#)turn.c 1.1 6/2/88 Copyright 1988 Gregory M. Paris";
  1518. X  #endif    lint
  1519. X  
  1520. X  #include    <stdio.h>
  1521. X
  1522. X--- 1,6 -----
  1523. X  /*    vi:set sw=4 ts=4: */
  1524. X  #ifndef    lint
  1525. X! static char    sccsid[] = "@(#)turn.c 2.1 6/15/88 Copyright 1988 Gregory M. Paris";
  1526. X  #endif    lint
  1527. X  
  1528. X  #include    <stdio.h>
  1529. X
  1530. X
  1531. X-- 
  1532. XGreg Paris                         <gmp@rayssd.ray.com>
  1533. X {att,decuac,gatech,necntc,sun,uiucdcs,ukma}!rayssd!gmp
  1534. XDon't look on the carpet; I threw something awful on it.
  1535. X
  1536. X
  1537. END_OF_cubes.pch1
  1538. if test 36850 -ne `wc -c <cubes.pch1`; then
  1539.     echo shar: \"cubes.pch1\" unpacked with wrong size!
  1540. fi
  1541. # end of overwriting check
  1542. fi
  1543. echo shar: End of shell archive.
  1544. exit 0
  1545.